#define _CRT_SECURE_NO_WARNINGS 1

#include"SList.h"


void SListTest1()
{
	SLTNode* plist = NULL;
	SLTPushBack(&plist, 1);
	SLTPushBack(&plist, 2);
	SLTPushBack(&plist, 3);
	SLTPushBack(&plist, 4);
	SLTPushBack(&plist, 5);
	SLTPrint(plist);
	SLTPushFront(&plist, 1);
	SLTPushFront(&plist, 2);
	SLTPushFront(&plist, 3);
	SLTPushFront(&plist, 4);
	
	SLTPushFront(&plist, 5);
	SLTPopBack(&plist);

	SLTPrint(plist);


}
void SListTest2()
{
	SLTNode* plist = NULL;
	SLTPushBack(&plist, 1);
	SLTPushBack(&plist, 2);
	SLTPushBack(&plist, 3);
	SLTPushBack(&plist, 4);
	SLTPushBack(&plist, 5);
	SLTPrint(plist);
	//SLTPopBack(&plist);
	//SLTPopBack(&plist);
	SLTPopFront(&plist);
	SLTPopFront(&plist);
	SLTPopFront(&plist);
	SLTPopFront(&plist);
	
	SLTPopFront(&plist);

	
	SLTPrint(plist);
}

void SListTest3()
{
	SLTNode* plist = NULL;
	SLTPushBack(&plist, 1);
	SLTPushBack(&plist, 2);
	SLTPushBack(&plist, 3);
	SLTPushBack(&plist, 4);
	SLTPushBack(&plist, 5);
	SLTPrint(plist);
	SLTInsert(&plist, SLTNodeFind(plist, 3), 6);
	SLTPrint(plist);
	SLTInsert(&plist,plist, 9);
	SLTInsert(&plist, SLTNodeFind(plist, 5), 8);
	SLTPrint(plist);
	//SLTInsertAfter
}
void SListTest4()
{
	SLTNode* plist = NULL;
	SLTPushBack(&plist, 1);
	SLTPushBack(&plist, 2);
	SLTPushBack(&plist, 3);
	SLTPushBack(&plist, 4);
	SLTPushBack(&plist, 5);
	SLTPrint(plist);
	SLTInsertAfter(SLTNodeFind(plist, 5), 9);
	SLTPrint(plist);

	SLTErase(&plist, plist);
	SLTPrint(plist);
	SLTErase(&plist, SLTNodeFind(plist, 3));
	SLTPrint(plist);
	// SLTEraseAfter(SLTNode* pos)
}

void SListTest5()
{
	SLTNode* plist = NULL;
	SLTPushBack(&plist, 1);
	SLTPushBack(&plist, 2);
	SLTPushBack(&plist, 3);
	SLTPushBack(&plist, 4);
	SLTPushBack(&plist, 5);
	SLTPrint(plist);
	SLTEraseAfter(SLTNodeFind(plist, 4));
	SLTPrint(plist);
}
int main()
 {
	//SListTest1();
	//SListTest2();
	//SListTest3();
	//SListTest4();
	 SListTest5();
	return 0;
}